﻿using System.Collections.Generic;

namespace Lexware.Tools.ProjectPropertyOverview
{
    /// <summary>
    /// 
    /// </summary>
    internal sealed class ProjectProjectConfigurationConstants
    {
        #region Private Members
        private static IDictionary<string, DefaultConfigurationPropertyItem> _predefinedConfigurationPropertiesAsDict;
        private static IList<DefaultConfigurationPropertyItem> _predefinedConfigurationProperties;
        #endregion

        /// <summary>
        /// 
        /// </summary>
        public const string WarningLevel = "WarningLevel";
        /// <summary>
        /// 
        /// </summary>
        public const string TreatwarningsAsErrors = "TreatWarningsAsErrors";
        /// <summary>
        /// 
        /// </summary>
        public const string RunCodeAnalysis = "RunCodeAnalysis";
        /// <summary>
        /// 
        /// </summary>
        public const string Outputpath = "OutputPath";
        /// <summary>
        /// 
        /// </summary>
        public const string DocumentationFile= "DocumentationFile";
        /// <summary>
        /// 
        /// </summary>
        public const string PlatformTarget = "PlatformTarget";
        ///// <summary>
        ///// 
        ///// </summary>
        //public const string CODE_ANALYSIS_RULES = "CodeAnalysisRules";
        /// <summary>
        /// 
        /// </summary>
        public const string CodeAnalysisRuleSet = "CodeAnalysisRuleSet";
        /// <summary>
        /// 
        /// </summary>
        public const string DefaultNamespace = "DefaultNamespace";
        /// <summary>
        /// 
        /// </summary>
        public const string Assemblyname = "AssemblyName";

        /// <summary>
        /// 
        /// </summary>
        public static IList<string> ConfigurationConstantNamesAsList 
        {
            get
            {
                return new List<string>
                                        {
                                            WarningLevel,
                                            TreatwarningsAsErrors,
                                            RunCodeAnalysis,
                                            Outputpath,
                                            DocumentationFile,
                                            PlatformTarget,
                                            CodeAnalysisRuleSet,
                                            //CODE_ANALYSIS_RULES,
                                            DefaultNamespace,
                                            Assemblyname
                                        };
            }
        }

        /// <summary>
        /// Gets the predefined configuration properties.
        /// </summary>
        /// <value>The predefined configuration properties.</value>
        public static IList<DefaultConfigurationPropertyItem> PredefinedConfigurationProperties
        {
            get
            {
                if (_predefinedConfigurationProperties == null)
                {
                    _predefinedConfigurationProperties = new List<DefaultConfigurationPropertyItem>
                                                               {
                                                                   new DefaultConfigurationPropertyItem(WarningLevel, "4"),
                                                                   new DefaultConfigurationPropertyItem(TreatwarningsAsErrors, true),
                                                                   new DefaultConfigurationPropertyItem(RunCodeAnalysis, true),
                                                                   new DefaultConfigurationPropertyItem(PlatformTarget, "x86"),
                                                                };
                    //const string codeAnalysisRules = @"+!Microsoft.Design#CA1012;-!Microsoft.Design#CA2210;+!Microsoft.Design#CA1040;+!Microsoft.Design#CA1005;+!Microsoft.Design#CA1020;+!Microsoft.Design#CA1021;+!Microsoft.Design#CA1010;+!Microsoft.Design#CA1011;+!Microsoft.Design#CA1009;+!Microsoft.Design#CA1050;+!Microsoft.Design#CA1026;+!Microsoft.Design#CA1019;+!Microsoft.Design#CA1031;+!Microsoft.Design#CA1047;+!Microsoft.Design#CA1000;+!Microsoft.Design#CA1048;+!Microsoft.Design#CA1051;+!Microsoft.Design#CA1002;+!Microsoft.Design#CA1061;+!Microsoft.Design#CA1006;+!Microsoft.Design#CA1046;+!Microsoft.Design#CA1045;+!Microsoft.Design#CA1038;+!Microsoft.Design#CA1008;+!Microsoft.Design#CA1028;-!Microsoft.Design#CA1004;+!Microsoft.Design#CA1035;+!Microsoft.Design#CA1063;+!Microsoft.Design#CA1032;+!Microsoft.Design#CA1023;+!Microsoft.Design#CA1033;+!Microsoft.Design#CA1039;+!Microsoft.Design#CA1016;+!Microsoft.Design#CA1014;+!Microsoft.Design#CA1017;+!Microsoft.Design#CA1018;+!Microsoft.Design#CA1027;-!Microsoft.Design#CA1059;+!Microsoft.Design#CA1060;-!Microsoft.Design#CA1034;+!Microsoft.Design#CA1013;+!Microsoft.Design#CA1036;+!Microsoft.Design#CA1044;+!Microsoft.Design#CA1041;+!Microsoft.Design#CA1025;+!Microsoft.Design#CA1052;+!Microsoft.Design#CA1053;+!Microsoft.Design#CA1057;+!Microsoft.Design#CA1058;+!Microsoft.Design#CA1001;+!Microsoft.Design#CA1049;+!Microsoft.Design#CA1054;+!Microsoft.Design#CA1056;+!Microsoft.Design#CA1055;+!Microsoft.Design#CA1030;+!Microsoft.Design#CA1003;+!Microsoft.Design#CA1007;+!Microsoft.Design#CA1043;+!Microsoft.Design#CA1024;+!Microsoft.Design#CA1062;+!Microsoft.Globalization#CA1301;+!Microsoft.Globalization#CA1302;+!Microsoft.Globalization#CA1303;+!Microsoft.Globalization#CA1306;+!Microsoft.Globalization#CA1304;+!Microsoft.Globalization#CA1305;+!Microsoft.Globalization#CA1300;+!Microsoft.Interoperability#CA1403;+!Microsoft.Interoperability#CA1406;+!Microsoft.Interoperability#CA1413;+!Microsoft.Interoperability#CA1402;+!Microsoft.Interoperability#CA1407;+!Microsoft.Interoperability#CA1404;+!Microsoft.Interoperability#CA1410;+!Microsoft.Interoperability#CA1411;+!Microsoft.Interoperability#CA1405;+!Microsoft.Interoperability#CA1409;+!Microsoft.Interoperability#CA1415;+!Microsoft.Interoperability#CA1408;+!Microsoft.Interoperability#CA1414;+!Microsoft.Interoperability#CA1412;+!Microsoft.Interoperability#CA1400;+!Microsoft.Interoperability#CA1401;+!Microsoft.Maintainability#CA1502;+!Microsoft.Maintainability#CA1501;+!Microsoft.Maintainability#CA1500;+!Microsoft.Mobility#CA1600;+!Microsoft.Mobility#CA1601;+!Microsoft.Naming#CA1718;+!Microsoft.Naming#CA1720;+!Microsoft.Naming#CA1700;+!Microsoft.Naming#CA1712;+!Microsoft.Naming#CA1713;+!Microsoft.Naming#CA1709;+!Microsoft.Naming#CA1708;+!Microsoft.Naming#CA1715;+!Microsoft.Naming#CA1710;+!Microsoft.Naming#CA1707;+!Microsoft.Naming#CA1722;+!Microsoft.Naming#CA1711;+!Microsoft.Naming#CA1716;+!Microsoft.Naming#CA1705;+!Microsoft.Naming#CA1725;+!Microsoft.Naming#CA1719;+!Microsoft.Naming#CA1721;+!Microsoft.Naming#CA1706;+!Microsoft.Naming#CA1724;+!Microsoft.Naming#CA1726;+!Microsoft.Performance#CA1809;+!Microsoft.Performance#CA1811;+!Microsoft.Performance#CA1812;+!Microsoft.Performance#CA1807;+!Microsoft.Performance#CA1813;+!Microsoft.Performance#CA1823;+!Microsoft.Performance#CA1816;+!Microsoft.Performance#CA1817;+!Microsoft.Performance#CA1800;+!Microsoft.Performance#CA1818;+!Microsoft.Performance#CA1805;+!Microsoft.Performance#CA1810;+!Microsoft.Performance#CA1822;+!Microsoft.Performance#CA1815;+!Microsoft.Performance#CA1814;+!Microsoft.Performance#CA1819;+!Microsoft.Performance#CA1804;+!Microsoft.Performance#CA1820;+!Microsoft.Performance#CA1802;+!Microsoft.Portability#CA1901;+!Microsoft.Portability#CA1900;+!Microsoft.Reliability#CA2000;+!Microsoft.Reliability#CA2002;+!Microsoft.Reliability#CA2003;+!Microsoft.Reliability#CA2004;+!Microsoft.Reliability#CA2006;+!Microsoft.Security#CA2116;+!Microsoft.Security#CA2117;+!Microsoft.Security#CA2105;+!Microsoft.Security#CA2115;+!Microsoft.Security#CA2104;+!Microsoft.Security#CA2122;+!Microsoft.Security#CA2114;+!Microsoft.Security#CA2123;+!Microsoft.Security#CA2111;+!Microsoft.Security#CA2108;+!Microsoft.Security#CA2107;+!Microsoft.Security#CA2103;+!Microsoft.Security#CA2100;+!Microsoft.Security#CA2118;+!Microsoft.Security#CA2109;+!Microsoft.Security#CA2119;+!Microsoft.Security#CA2106;+!Microsoft.Security#CA2112;+!Microsoft.Security#CA2110;+!Microsoft.Security#CA2120;+!Microsoft.Security#CA2101;+!Microsoft.Security#CA2121;+!Microsoft.Security#CA2126;+!Microsoft.Security#CA2124;+!Microsoft.Usage#CA2209;+!Microsoft.Usage#CA2236;+!Microsoft.Usage#CA2227;+!Microsoft.Usage#CA2213;+!Microsoft.Usage#CA2216;+!Microsoft.Usage#CA2215;+!Microsoft.Usage#CA2214;+!Microsoft.Usage#CA2222;+!Microsoft.Usage#CA2202;+!Microsoft.Usage#CA1806;+!Microsoft.Usage#CA2217;+!Microsoft.Usage#CA2212;+!Microsoft.Usage#CA2219;+!Microsoft.Usage#CA2201;+!Microsoft.Usage#CA2228;+!Microsoft.Usage#CA2221;+!Microsoft.Usage#CA2220;+!Microsoft.Usage#CA2240;+!Microsoft.Usage#CA2229;+!Microsoft.Usage#CA2238;+!Microsoft.Usage#CA2207;+!Microsoft.Usage#CA2208;+!Microsoft.Usage#CA2235;+!Microsoft.Usage#CA2237;+!Microsoft.Usage#CA2232;+!Microsoft.Usage#CA2223;+!Microsoft.Usage#CA2211;+!Microsoft.Usage#CA2233;+!Microsoft.Usage#CA2225;+!Microsoft.Usage#CA2226;+!Microsoft.Usage#CA2231;+!Microsoft.Usage#CA2224;+!Microsoft.Usage#CA2218;+!Microsoft.Usage#CA2234;+!Microsoft.Usage#CA2241;+!Microsoft.Usage#CA2239;+!Microsoft.Usage#CA2200;+!Microsoft.Usage#CA1801;+!Microsoft.Usage#CA2205;+!Microsoft.Usage#CA2230;";
                    //_predefinedConfigurationProperties.Add(new DefaultConfigurationPropertyItem(CODE_ANALYSIS_RULES, codeAnalysisRules));
                }
                return _predefinedConfigurationProperties;
            }
        }

        /// <summary>
        /// Gets the predefined configuration properties as dict.
        /// </summary>
        /// <value>The predefined configuration properties as dict.</value>
        public static IDictionary<string, DefaultConfigurationPropertyItem> PredefinedConfigurationPropertiesAsDict
        {
            get
            {
                if (_predefinedConfigurationPropertiesAsDict == null)
                {
                    _predefinedConfigurationPropertiesAsDict = new Dictionary<string, DefaultConfigurationPropertyItem>();

                    foreach (DefaultConfigurationPropertyItem item in PredefinedConfigurationProperties)
                    {
                        _predefinedConfigurationPropertiesAsDict.Add(item.Name, item);
                    }
                }
                return _predefinedConfigurationPropertiesAsDict;
            }
        }

    }
}
